<?php

namespace App\Http\Controllers\admin;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use DB;
class AdminController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function admin()
    {
		/* //左连接
		 $nn = DB::table('v8_list')
		   ->leftjoin('cats','goods.cat_id','=','cats.cat_id')
		   ->select('goods.goods_name','cats.cat_name')
		   ->where('cats.cat_id','=',11)
		   ->get();
		   dd($nn);
		//聚合
		$hh = DB::table('v8_list')
		 ->groupBy('字段')
		 ->having('字段','>',8)
		 ->select('字段',DB::raw('count(*) as number'))
		 ->where('cats.cat_id','=',11)
		 ->get();
		 dd($hh);
		$gg = DB::table('v8_list')->max('内容');
		$ff = DB::table('v8_list')->count();
		dd($ff);
		$dd = DB::table('v8_list')->where('id','>',2)->delect();
		dd($dd);
		$cc = DB::table('v8_list')->where('id',2)->update(['content'].)
		//echo "11dklk";die;
		$bb = ['rolename'=>'1','yonghu'=>'2','describe'=>'3'];
		$aa = DB::table('v8_list')->insert($bb);
		//dd($aa);
        //$aa = DB::table('v8_list')->get();
		//dd($aa); */
		$yonghu = DB::table('v8_list')->orderBy('id','desc')->paginate(2);
		return view('admin/admins.index',['yonghu'=>$yonghu]);
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        //
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        //
    }

    /**
     * Display the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function show($id)
    {
        //
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function edit($id)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, $id)
    {
        //
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function destroy($id)
    {
        //
    }
}
